﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ETL.Business.Handlers.ProjectManagementHelper;
using ETL.Business.Handlers.ProjectNamesHandler;
using ETL.Business.Models;
using WebMatrix.WebData;

namespace ETL.Web.CustomCredential
{
    public class ETLCredential
    {
        public static string UserId
        {
            get { return WebSecurity.CurrentUserName.ToString(); }
        }
        public static string UserFullName
        {
            get
            {
                var model = (new GetUserById()).Execute(WebSecurity.CurrentUserName);
                if (model != null)
                    return model.Name;
                else return string.Empty;
            }
        }
        public static string [] AllAdminUsers()
        {
            var allAdminUsers = new List<string>();

            var allUser = (new GetAllProjectManagement()).Execute();
            foreach (ProjectMangementModel admin in allUser)
            {
                allAdminUsers.Add(admin.Id);
            }
            return allAdminUsers.ToArray();
        }
    }
}
